<?php
/* @var $this FullRoutingController */
/* @var $model FullRouting */

$this->breadcrumbs=array(
	Yii::t('base','Full Routings')=>array('admin'),
	Yii::t('base','Manage'),
);
/*
$this->menu=array(
	array('label'=>'List FullRouting', 'url'=>array('index')),
	array('label'=>'Create FullRouting', 'url'=>array('create')),
);
*/
Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$('#full-routing-grid').yiiGridView('update', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1><?php echo Yii::t('base','Manage');?><?php echo Yii::t('base','Full Routings');?></h1>

<p class="red"><?php echo Yii::t('base','Note: Whether you create, open, closed, full routing, routers need to restart to take effect.');?></p>


<?php echo Yii::t('base','<p>
You may optionally enter a comparison operator (<b>&lt;</b>, <b>&lt;=</b>, <b>&gt;</b>, <b>&gt;=</b>, <b>&lt;&gt;</b>
or <b>=</b>) at the beginning of each of your search values to specify how the comparison should be done.
</p>');?>

<?php echo CHtml::link(Yii::t('base','Advanced Search'),'#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->
<a class="btn btn-small create" title="<?php echo Yii::t('base','Create Full Routing')?>" href="<?php echo Yii::app()->request->baseUrl; ?>/fullRouting/create"><?php echo Yii::t('base','Create Full Routing')?></a>
<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'full-routing-grid',
	'dataProvider'=>$model->search(),
	//'filter'=>$model,
	'itemsCssClass'=>'responsive table table-striped table-bordered',
	'pager'=>array('class'=>'CLinkPager','hiddenPageCssClass'=>'','firstPageCssClass'=>'first paginate_button','htmlOptions'=>array('class'=>'dataTables_paginate paging_full_numbers"'),'header'=>""),
	'pagerCssClass'=>'pagination',
	'cssFile'=>false,
	'template'=>'{items}{summary}{pager}',
	'columns'=>array(
		//'vpnlist_id',
		array('name'=>'vpnlist_id','header'=>Yii::t('base','Server'),'value'=>'Vpnlist::model()->find("id=".$data->vpnlist_id)->comment'),
		//'open_time',
		array('name'=>'open_time','header'=>Yii::t('base','Open Time')),
		//'mark',
		array('name'=>'mark','header'=>Yii::t('base','Mark'),'value'=>'FullRouting::model()->getMarkCnName($data->mark)'),
		/*
		'create_time',
		'update_time',
		*/
		array(
			'class'=>'CButtonColumn',
			'header'=>Yii::t('base','Operate'),
			'updateButtonImageUrl'=>array('class'=>'gicon-edit'),
			'updateButtonOptions'=>array('class'=>'btn btn-small'),
			'deleteButtonImageUrl'=>array('class'=>'gicon-edit'),
			'updateButtonUrl'=>'Yii::app()->createUrl("fullRouting/update",array("id"=>$data->full_routing_id))',
			'deleteButtonUrl'=>'Yii::app()->createUrl("fullRouting/delete",array("id"=>$data->full_routing_id))',
			'deleteButtonOptions'=>array('class'=>'btn btn-inverse btn-small'),
			'template'=>'{delete}{update}{Open/Close}',
			'buttons'=>array(
					'Open/Close'=>array(
						'label'=>Yii::t('base','Open/Close'),
						'url'=>'Yii::app()->createUrl("fullRouting/ChangeMark",array("full_routing_id"=>$data->full_routing_id,"mark"=>$data->mark))',
						'options'=>array('class'=>'btn btn-small','id'=>'click'),
						'visible'=>'Yii::app()->user->level==2 || Yii::app()->user->level==3'
					),
		),
			'headerHtmlOptions'=>array('style'=>'width:30%'),
		),
	),
)); 
?>
